<?php if (!defined('PmWiki')) exit();

##  This is a sample config.php file.  To use this file, copy it to
##  local/config.php, then edit it for whatever customizations you want.
##  Also, be sure to take a look at http://www.pmwiki.org/wiki/Cookbook
##  for more details on the types of customizations that can be added
##  to PmWiki.

## This config.php file adds several features and options to the
## pmwiki-efo derivative of pmwiki. See https://code.google.com/p/pmwiki-efo/

# == CORE ==

##  $WikiTitle is the name that appears in the browser's title bar.
$WikiTitle = 'PmWiki-efo';

##  $ScriptUrl is your preferred URL for accessing wiki pages
##  $PubDirUrl is the URL for the pub directory.
# $ScriptUrl = 'http://www.mydomain.com/path/to/pmwiki.php';
# $PubDirUrl = 'http://www.mydomain.com/path/to/pub';

##  If you want to use URLs of the form .../pmwiki.php/Group/PageName
##  instead of .../pmwiki.php?p=Group.PageName, try setting
##  $EnablePathInfo below.  Note that this doesn't work in all environments,
##  it depends on your webserver and PHP configuration.  You might also 
##  want to check http://www.pmwiki.org/wiki/Cookbook/CleanUrls more
##  details about this setting and other ways to create nicer-looking urls.
$EnablePathInfo = 1;

## WikiGroup used by default (on startup) when no group is specified in the URL. 
$DefaultGroup = "Main";

## Name of the default HomePage of each WikiGroup. Used when the group doesn't have a page with the same name as the group.     
$DefaultName = "HomePage";


## Enable the quiet=1 parameter for the redirect directive. On publicly edited wikis it is advisable not to enable quiet redirects. 
$EnableRedirectQuiet = 1; 

## $PageLogoUrl is the URL for a logo image -- you can change this
## to your own logo if you wish.
# $PageLogoUrl = "$PubDirUrl/skins/pmwiki/pmwiki-32.gif";
# $PageLogoUrl = "$PubDirUrl/skins/logo.png";
# $PageLogoUrl = "$SkinDirUrl/logo.png";
# leave this line empty to display no general logo:
$PageLogoUrl = 


$TimeFmt = '%Y-%m-%d, %T'; # dates as "2013-08-11"

## If you want to hide the whole action bar, uncomment this:
# SetTmplDisplay('PageActionFmt',0);


# == SKINS ==

## If you want to have a custom skin, then set $Skin to the name
## of the directory (in pub/skins/) that contains your skin files.
## See PmWiki.Skins and Cookbook.Skins.

include_once("$FarmD/cookbook/detect_mobile.php");

# note: we disable detect_mobile cookbook, because we favor responsive
# designs. But you can still uncomment the part below to re-enable it.

#if(detect_mobile_device()) {
#   $Skin = 'handheld'; # phone mobile skin
#} else {
   #$Skin = 'pmwiki';
   #$Skin = 'literature';
   #$Skin = 'dropshadow';
   #$Skin = 'enlighten-green';
   #$Skin = 'enlighten-ocre';
   #$Skin = 'enlighten-brown';
   $Skin = 'marinee';
   #$Skin = 'abitold';
   #$Skin = 'fravashyo';
   #$Skin = 'newspaper';
   #$Skin = 'light';
   #$Skin = 'academian';
   #$Skin = 'bootstrap'; # works ok
   #$Skin = 'bootstrap_v2'; #doesn't work, don't use it
   $Skin = 'pmwiki-bootstrap-skin';  # works rather well
#} 

# SkinChange: http://www.pmwiki.org/wiki/Cookbook/SkinChange
$EnableAutoSkinList = 1;
include_once("$FarmD/cookbook/skinchange.php");


# == PASSWORDS ==

## You'll probably want to set an administrative password that you
## can use to get into password-protected pages.  Also, by default 
## the "attr" passwords for the PmWiki and Main groups are locked, so
## an admin password is a good way to unlock those.  See PmWiki.Passwords
## and PmWiki.PasswordsAdmin.
## you can also see http://www.pmwiki.org/wiki/PmWiki/AuthUser
#

## require a password to fully administrate the pages:
$DefaultPasswords['admin'] = crypt('demo');

# require a password to simply edit the pages:
$DefaultPasswords['edit'] = crypt('demo'); 

## require a password to read the pages:
#$DefaultPasswords['read'] = crypt('pmwiki');
## require to be logged in (using groups...) to read the pages:
#$DefaultPasswords['read'] = 'id:*';


# == EXTRA OPTIONS ==

## Unicode (UTF-8) allows the display of all languages and all alphabets.
include_once($FarmD.'/scripts/xlpage-utf-8.php');

## If you're running a publicly available site and allow anyone to
## edit without requiring a password, you probably want to put some
## blocklists in place to avoid wikispam.  See PmWiki.Blocklist.
# $EnableBlocklist = 1;                    # enable manual blocklists
# $EnableBlocklist = 10;                   # enable automatic blocklists

##  PmWiki comes with graphical user interface buttons for editing;
##  to enable these buttons, set $EnableGUIButtons to 1.  
$EnableGUIButtons = 1;

##  To enable markup syntax from the Creole common wiki markup language
##  (http://www.wikicreole.org/), include it here:
## NOTE: the txt2tags syntax is very similar, so you shouln't need the creole script
# include_once("scripts/creole.php");

##  Some sites may want leading spaces on markup lines to indicate
##  "preformatted text blocks", set $EnableWSPre=1 if you want to do
##  this.  Setting it to a higher number increases the number of
##  space characters required on a line to count as "preformatted text".
# $EnableWSPre = 1;   # lines beginning with space are preformatted (default)
# $EnableWSPre = 4;   # lines with 4 or more spaces are preformatted
# $EnableWSPre = 0;   # disabled

## PageTopStore: separate content and backup. 
## http://www.pmwiki.org/wiki/Cookbook/PageTopStore
#  Use with care. For now it's not enabled by default.

# include_once("$FarmD/cookbook/pagetopstore.php");
# $WikiDir = new PageTopStore( 'wiki.d/{$FullName}', 'wikitop.d/{$FullName}' );

## PageTopStore: will limit the automagic behaviour of the recipe such that pages are written to disk only explicitly:
# $EnablePageTopStoreAutofill = FALSE; 



##  If you want uploads enabled on your system, set $EnableUpload=1.
##  You'll also need to set a default upload password, or else set
##  passwords on individual groups and pages.  For more information
##  see PmWiki.UploadsAdmin.
$EnableUpload = 1;
#$DefaultPasswords['upload'] = crypt('pmwiki');
$HandleAuth['upload'] = 'edit';      # users with edit rights can upload
$EnableUploadOverwrite = 0;

$UploadExts = array(
  'ogg' => 'audio/ogg',
  'ogv' => 'video/ogv',
  'mp4' => 'video/mp',
  'webm' => 'video/webm',
);

# Change this to 1 if you wish to force your users to sign their posts (may prevent some spam)
$EnablePostAuthorRequired = 0;

## Upload folder
$UploadPrefixFmt = '';
$UploadDir = "./uploads";
#$UploadUrlFmt = "http://example.com/~foobar/uploads";

$EnableUploadVersions=1;             # versionning of upload files

#$UploadPrefixQuota = 502400;        # limit group uploads to 500 ko

$UploadDirQuota = 150240000;          # limit total uploads to 150000K 

$UploadMaxSize = 2502400;             # to limit upload file to 2500 kb

##  Setting $EnableDiag turns on the ?action=diag and ?action=phpinfo
##  actions, which often helps others to remotely troubleshoot 
##  various configuration and execution problems.
# $EnableDiag = 1;                         # enable remote diagnostics

##  By default, PmWiki doesn't allow browsers to cache pages.  Setting
##  $EnableIMSCaching=1; will re-enable browser caches in a somewhat
##  smart manner.  Note that you may want to have caching disabled while
##  adjusting configuration files or layout templates.
# $EnableIMSCaching = 1;                   # allow browser caching

##  Set $SpaceWikiWords if you want WikiWords to automatically 
##  have spaces before each sequence of capital letters.
# $SpaceWikiWords = 1;                     # turn on WikiWord spacing

##  Set $EnableWikiWords if you want to allow WikiWord links.
##  For more options with WikiWords, see scripts/wikiwords.php .
# $EnableWikiWords = 1;                      # enable WikiWord links

##  $DiffKeepDays specifies the minimum number of days to keep a page's
##  revision history.  The default is 3650 (approximately 10 years).
# $DiffKeepDays=30;                        # keep page history at least 30 days

## By default, viewers are prevented from seeing the existence
## of read-protected pages in search results and page listings,
## but this can be slow as PmWiki has to check the permissions
## of each page.  Setting $EnablePageListProtect to zero will
## speed things up considerably, but it will also mean that
## viewers may learn of the existence of read-protected pages.
## (It does not enable them to access the contents of the
## pages.)
# $EnablePageListProtect = 0;

##  The refcount.php script enables ?action=refcount, which helps to
##  find missing and orphaned pages.  See PmWiki.RefCount.
# if ($action == 'refcount') include_once("scripts/refcount.php");

##  The feeds.php script enables ?action=rss, ?action=atom, ?action=rdf,
##  and ?action=dc, for generation of syndication feeds in various formats.
if ($action == 'rss')  include_once("scripts/feeds.php");  # RSS 2.0
# if ($action == 'atom') include_once("scripts/feeds.php");  # Atom 1.0
# if ($action == 'dc')   include_once("scripts/feeds.php");  # Dublin Core
# if ($action == 'rdf')  include_once("scripts/feeds.php");  # RSS 1.0

# RSS feed appearance
$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} : &nbsp; $LastModifiedSummary (by {$Author})';

##  In the 2.2.0-beta series, {$var} page variables were absolute, but now
##  relative page variables provide greater flexibility and are recommended.
##  (If you're starting a new site, it's best to leave this setting alone.)
$EnableRelativePageVars = 1; # 1=relative; 0=absolute

##  By default, pages in the Category group are manually created.
##  Uncomment the following line to have blank category pages
##  automatically created whenever a link to a non-existent
##  category page is saved.  (The page is created only if
##  the author has edit permissions to the Category group.)
# $AutoCreate['/^Category\\./'] = array('ctime' => $Now);

##  PmWiki allows a great deal of flexibility for creating custom markup.
##  To add support for '*bold*' and '~italic~' markup (the single quotes
##  are part of the markup), uncomment the following lines. 
##  (See PmWiki.CustomMarkup and the Cookbook for details and examples.)
# Markup("'~", "inline", "/'~(.*?)~'/", "<i>$1</i>");        # '~italic~'
# Markup("'*", "inline", "/'\\*(.*?)\\*'/", "<b>$1</b>");    # '*bold*'

# remove rel=nofollow
# you can comment this if you're using an open wiki (editable by everyone)
$UrlLinkFmt =
"<a class='urllink' href='\$LinkUrl' title='\$LinkAlt'>\$LinkText</a>";
      
     

##  If you want to have to approve links to external sites before they
##  are turned into links, uncomment the line below.  See PmWiki.UrlApprovals.
##  Also, setting $UnapprovedLinkCountMax limits the number of unapproved
##  links that are allowed in a page (useful to control wikispam).
# $UnapprovedLinkCountMax = 10;
# include_once("scripts/urlapprove.php");

##  The following lines make additional editing buttons appear in the
##  edit page for subheadings, lists, tables, etc.
# $GUIButtons['h2'] = array(400, '\\n!! ', '\\n', '$[Heading]',
#                     '$GUIButtonDirUrlFmt/h2.gif"$[Heading]"');
# $GUIButtons['h3'] = array(402, '\\n!!! ', '\\n', '$[Subheading]',
#                     '$GUIButtonDirUrlFmt/h3.gif"$[Subheading]"');
# $GUIButtons['indent'] = array(500, '\\n->', '\\n', '$[Indented text]',
#                     '$GUIButtonDirUrlFmt/indent.gif"$[Indented text]"');
# $GUIButtons['outdent'] = array(510, '\\n-<', '\\n', '$[Hanging indent]',
#                     '$GUIButtonDirUrlFmt/outdent.gif"$[Hanging indent]"');
# $GUIButtons['ol'] = array(520, '\\n# ', '\\n', '$[Ordered list]',
#                     '$GUIButtonDirUrlFmt/ol.gif"$[Ordered (numbered) list]"');
# $GUIButtons['ul'] = array(530, '\\n* ', '\\n', '$[Unordered list]',
#                     '$GUIButtonDirUrlFmt/ul.gif"$[Unordered (bullet) list]"');
# $GUIButtons['hr'] = array(540, '\\n----\\n', '', '',
#                     '$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"');
# $GUIButtons['table'] = array(600,
#                       '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n||     ||     ||     ||\\n||     ||     ||     ||\\n', '', '', 
#                     '$GUIButtonDirUrlFmt/table.gif"$[Table]"');


# == ADDITIONAL COOKBOOKS ==

## PmFeed http://www.pmwiki.org/pmwiki/uploads/Cookbook/pmfeed.php
## (doesn't seem to work...)
# include_once("$FarmD/cookbook/pmfeed.php");

## http://www.pmwiki.org/wiki/Cookbook/InlineRSS 
include_once("$FarmD/cookbook/PMinlineRSS/PMinlineRSSt2t.php");

## Enable the txt2tags syntax instead of the pmwiki one. http://www.pmwiki.org/wiki/Cookbook/txt2tags
require_once ("$FarmD/cookbook/txt2tags.php"); 
#require_once ("$FarmD/cookbook/txt2tagspmw.php");  # (doesn't work)

## Add extra markup to txt2tags, from the textallion project. http://www.pmwiki.org/wiki/Cookbook/textallion
require_once ("$FarmD/cookbook/textallion.php"); 

# Gallery

include_once("$FarmD/cookbook/mini.php");
$Mini['FixFilenames'] = 1;
# enable ultralightbox slideshow. Comment to simply link to images
$Mini['EnableLightbox'] = 1;

# if you wish to enable lightbox instead of ultralightbox (not adviced), 
# unzip the lb.zip in the pub/ and uncomment the next lines:
#$Mini['LbUrl'] = '$FarmPubDirUrl/lb';
#$Mini['LbFiles'] = array('prototype.js', 'builder.js', 'effects.js', 'mini-lightbox.js', 'lightbox.js', 'lightbox.css');
   

## http://www.pmwiki.org/wiki/Cookbook/SimpleDiscussLink
## Create a {$BaseName} page variable for "-Talk" pages.
if (preg_match('/-Talk$/', $pagename)) { $BaseNamePatterns['/-Talk$/'] = ''; }


## Uncomment this if you want to enable French:
#XLPage('fr','PmWikiFr.XLPage');
## in PmWikiFr.XLPage translations, you may need to modify the 'Locale' entry to:  'Locale' => 'fr_FR.utf8',
## You can also change the locale for the whole site here:
#setlocale(LC_ALL, "fr_FR.utf8");

# Multilanguages
include_once('cookbook/multilanguage.php');
$DefaultLanguages = array('en','fr');

# Change this too if you want to enable some French inclusions for multilanguage:
$userlang = en;
#$userlang = fr;


## Table of Contents: http://www.pmwiki.org/wiki/Cookbook/PageTableOfContents
include_once("$FarmD/cookbook/pagetoc.php");
#include_once("$FarmD/cookbook/pagetoc-fr.php");

# specific translation expression
XLSDV('fr', array('Page last modified on'=>'Dernière modification de cette page le'));
XLSDV('fr', array('search'=>'rechercher'));

# for blog-it
XLSDV('fr', array('Recently Written'=>'Dernièrement écrit'));
XLSDV('fr', array('Recent Comments'=>'Derniers commentaires'));
XLSDV('fr', array('Categories'=>'Catégories'));
XLSDV('fr', array('more...'=>'plus...'));
XLSDV('fr', array('Leave a comment'=>'Laisser un commentaire'));
XLSDV('fr', array('All comments are reviewed before being displayed.'=>'Tous les commentaires sont vérifiés avant publication.'));
XLSDV('fr', array('By'=>'Par'));
XLSDV('fr', array('on'=>'le'));
XLSDV('fr', array('edit'=>'éditer'));
XLSDV('fr', array('at'=>'à'));
XLSDV('fr', array('Enter value:'=>'Entrez le nombre :'));
XLSDV('fr', array('Post'=>'Poster'));

XLSDV('fr', array('(Edit Section &#x2193;)'=>'[Éditer la section &#x2193;]'));



# date
include_once("cookbook/EZDate.php");


#enable some html tags
include_once("$FarmD/cookbook/enablehtml.php");


#EnableHtml('img');
#EnableHtml('b|i|u|sup|sub|a|iframe|small');
EnableHtml('iframe|video');

Markup('html', 'fulltext', '/\\(:html:\\)(.*?)\\(:htmlend:\\)/esi',
  "'<:block>'.Keep(str_replace(array('&gt;','&lt;','&amp;'), array('>','<','&'), PSS('$1')))");

if (!CondAuth($pagename,"admin"))
  { $ROSPatterns["/\\(:html:\\)/i"] = "[:html:]";
    $ROSPatterns["/\\(:htmlend:\\)/i"] = "[:htmlend:]";
  }
         

## FOX (forms)

# allow comment posting for all visitors in group 'Public'
$group = PageVar($pagename, '$Group');
if ($group=='Public') {
   $FoxAuth = 'read';
   $FoxPagePermissions['Public.*'] = 'add';
}
# allow all foxactions on all pages for admin 
# (Site and SiteAdmin groups remain excluded)
if (CondAuth($pagename,'admin')) {
   $EnableFoxUrlInput = 'true';
   $FoxPagePermissions['*.*'] = 'all'; 
}

include_once("$FarmD/cookbook/fox/fox.php");     

include_once("$FarmD/cookbook/fox/foxedit.php");
include_once("$FarmD/cookbook/fox/foxdelete.php");
               

## FOX end


## BLOG IT ## http://www.pmwiki.org/wiki/Cookbook/BlogIt

# include this before calling blogit
# some actions may not be compatible with the txt2tags cookbook, in particular the ones involving normal-ajax, ajax-normal 
SDVA($bi_Ajax, array('bi_ce'=>'normal', 'bi_ca'=>'normal', 'bi_cua'=>'normal', 'bi_be'=>'normal', 'bi_ne'=>'normal', 'bi_del'=>'normal')); #key: action; value: ajax style
SDV($bi_DateStyle, 'dmy'); # date order

## change publish to default
$bi_Hooks['blog']['pre-entry'][]='processBlogsPreEntry';
function processBlogsPreEntry($src, $auth){
global $_POST,$action;
	if ($action=='bi_ne')  $_POST['ptv_entrystatus']='publish';
}

## change default page name 
$bi_Hooks['blog']['pre-entry'][]='processBlogsPrePagename';
function processBlogsPrePagename($src, $auth){
global $_POST,$action;
$today = date("Y-m-d");
	if ($action=='bi_ne')  $_POST['ptv_entryurl']='Blog.'.$today;
}


## change template title  
$bi_Hooks['blog']['pre-entry'][]='processBlogsPreTitlename';
function processBlogsPreTitlename($src, $auth){
global $_POST,$action;
$today = date("Y-m-d");
	if ($action=='bi_ne')  $_POST['ptv_entrytitle']="Title ".$today;
}


## modify default blogit css path so we can change it
$PageCSSListFmt['pub/blogit/blogit-pmwiki.css'] = '$PubDirUrl/blogit/blogit-mod.css';  

## include captcha for comments
## http://www.pmwiki.org/wiki/Cookbook/Captcha

$EnableCaptchaImage=1;
if (!CondAuth($pagename,'edit')) $EnablePostCaptchaRequired = 1;
include_once("$FarmD/cookbook/captcha.php");

# we can also completely disable comments:
# $bi_CommentsEnabled='none';

# You can comment this if you don't need the Blog feature
# or uncomment it if you need it.
include_once("$FarmD/cookbook/blogit/blogit.php");

$HandleAuth['source'] = 'edit';  #Prevents non authorized users from viewing comment source email address
$HandleAuth['diff'] = 'edit';  #Prevents non authorized users from viewing comment source email address
$MaxIncludes=550;  #BlogIt makes heavy use of includes, so this needs to be increased.

## Blog it end ##


## Favicon
$HTMLHeaderFmt['icon'] = '<link rel="icon" href="/pmwiki-efo/favicon.png" type="image/png" />';
  

## Disable author signature so we can use ~~~~ elsewhere 
$EnableAuthorSignature = 0 ;


## Music

## Abcmusic cookbook
#include_once("cookbook/abcmusic.php");
#$ABCProgs['abcm2ps']  = '/usr/bin/abcm2ps';
#$ABCProgs['abc2midi'] = '/usr/bin/abc2midi';
#$ABCProgs['gs']       = '/usr/bin/gs';
#$ABCProgs['ppmtogif'] = '/usr/bin/ppmtogif';
#$ABCProgs['pnmcrop']  = '/usr/bin/pnmcrop';

## Music notation cookbook
#include_once("cookbook/content.php");
#include_once("cookbook/music.php"); 

## Music end



## HTML5 Videos: http://www.pmwiki.org/wiki/Cookbook/HTML5Video
include_once("$FarmD/cookbook/HTML5Video.php"); 
$HTML5VideoDir = '../../uploads/';
#$HTML5VideoDir = 'http://yourdomain.org/videos/';
# see http://diveintohtml5.org/video.html
# in httpd.conf add:
# AddType video/ogg .ogv
# AddType video/mp4 .mp4
# AddType video/webm .webm

## HTML5 Audio: http://www.pmwiki.org/wiki/Cookbook/HTML5Audio
include_once("$FarmD/cookbook/HTML5Audio.php"); 

## DictIndex: http://www.pmwiki.org/wiki/Cookbook/DictIndex
include_once('cookbook/titledictindex.php');

## Social tools
## disable them on intranet or local installation
## Google plus one 
# require_once("$FarmD/cookbook/googleplusone.php"); 
## AddThis: http://www.pmwiki.org/wiki/Cookbook/AddThisWidget
# include_once("$FarmD/cookbook/addthis.php");

## Attachtable: http://www.pmwiki.org/wiki/Cookbook/Attachtable

switch($action) {
  case 'delattach':
  case 'renameattach':
  case 'downloaddeleted':
    include_once("$FarmD/cookbook/attachtable/attachtable-actions.php");
    break;
  case 'fileinfo':
  case 'thumbnail':
    include_once("$FarmD/cookbook/attachtable/fileinfo.php");
    break;
  case 'upload':
  default:
    include_once("$FarmD/cookbook/attachtable/attachtable.php");
    break;
}


## Preview changes http://www.pmwiki.org/wiki/Cookbook/PreviewChanges

if(@$_REQUEST['preview']>'') include_once("$FarmD/cookbook/previewchanges.php"); 


## http://www.pmwiki.org/wiki/Cookbook/PowerTools
include_once("$FarmD/cookbook/powertools.php");

## http://www.pmwiki.org/wiki/Cookbook/SectionEdit
# $SectionEditWithoutHeaders = true;
include_once("$FarmD/cookbook/sectionedit_t2t.php");

# http://www.pmwiki.org/wiki/Cookbook/MarkupExprPlus
include_once("$FarmD/cookbook/markupexprplus.php");


## Change summary input size (from 60 to 30) for mobile devices

if(detect_mobile_device()) {
   SDVA($InputTags['e_changesummary'], array(
  ':html' => "<input type='text' \$InputFormArgs />",
  'name' => 'csum', 'size' => '30', 'maxlength' => '100',
  'value' => htmlspecialchars(stripmagic(@$_POST['csum']), ENT_QUOTES)));
} else {

} 

## backup wiki.d pages
# http://www.pmwiki.org/wiki/Cookbook/BackupPages
# TODO

## http://www.pmwiki.org/wiki/Cookbook/Flash
#include_once("$FarmD/cookbook/flash2.php");
include_once("$FarmD/cookbook/swf-sites.php");


# TODO add urlify from https://github.com/gambhiro/pmwiki-kit-bootstrap-compass ?

## Vietmap http://www.pmwiki.org/wiki/Cookbook/VietMap

include_once("$FarmD/cookbook/vietmap.php");

# http://www.pmwiki.org/wiki/Cookbook/Datepicker
include_once("cookbook/datepicker.php"); 
$DatepickerFormat = 'Y-m-d'; 

# http://www.pmwiki.org/wiki/Cookbook/SortableTables
include_once('cookbook/sortable.php');

?>
